<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <div id="result"></div>
    <div id="result1"></div>
</body>
<script type="text/javascript">
    var source=new EventSource("http://localhost/test/demo_sse.php");
source.onmessage=function(event)
{
    document.getElementById("result").innerHTML+=event.data + "<br>";
};
</script>
</html>